package com.coder.books.thinkinjava.concurrency;

/**
 * int 生成器
 *
 * @author yuhushuan
 * @date 2020/9/2 07:12
 */
public abstract class IntGenerator {
    private volatile boolean canceled = false;

    public abstract int next();

    public void cancel() {
        canceled = true;
    }

    public boolean isCanceled() {
        return canceled;
    }

}
